subarch apicdef.h and ipi.h can be much simplified.
Signed-off-by: Keir Fraser <keir@xensource.com>
* APIC driver for "bigsmp" XAPIC machines with more than 8 virtual CPUs.
* Drives the local APIC in "clustered mode".
*/
-#define APIC_DEFINITION 1
#include <xen/config.h>
#include <xen/cpumask.h>
#include <asm/current.h>
#include <xen/smp.h>
#include <xen/init.h>
#include <xen/dmi.h>
+#include <asm/mach_ipi.h>
#include <asm/mach-bigsmp/mach_apic.h>
-#include <asm/mach-bigsmp/mach_apicdef.h>
-#include <asm/mach-bigsmp/mach_ipi.h>
#include <asm/mach-default/mach_mpparse.h>
static int dmi_bigsmp; /* can be set by dmi scanners */
return dmi_bigsmp;
}
-struct genapic apic_bigsmp = APIC_INIT("bigsmp", probe_bigsmp);
+struct genapic apic_bigsmp = {
+ APIC_INIT("bigsmp", probe_bigsmp),
+ .send_ipi_mask = send_IPI_mask_sequence
+};
/*
* Default generic APIC driver. This handles upto 8 CPUs.
*/
-#define APIC_DEFINITION 1
#include <xen/config.h>
#include <xen/cpumask.h>
#include <asm/current.h>
#include <asm/mpspec.h>
-#include <asm/mach-default/mach_apicdef.h>
#include <asm/genapic.h>
#include <asm/fixmap.h>
#include <asm/apicdef.h>
#include <xen/string.h>
#include <xen/smp.h>
#include <xen/init.h>
+#include <asm/mach_ipi.h>
#include <asm/mach-default/mach_apic.h>
-#include <asm/mach-default/mach_ipi.h>
#include <asm/mach-default/mach_mpparse.h>
/* should be called last. */
return 1;
}
-struct genapic apic_default = APIC_INIT("default", probe_default);
+struct genapic apic_default = {
+ APIC_INIT("default", probe_default),
+ .send_ipi_mask = send_IPI_mask_bitmask
+};
/*
* APIC driver for the Unisys ES7000 chipset.
*/
-#define APIC_DEFINITION 1
#include <xen/config.h>
#include <xen/cpumask.h>
#include <asm/current.h>
#include <xen/string.h>
#include <xen/smp.h>
#include <xen/init.h>
-#include <asm/mach-es7000/mach_apicdef.h>
+#include <asm/mach_ipi.h>
#include <asm/mach-es7000/mach_apic.h>
-#include <asm/mach-es7000/mach_ipi.h>
#include <asm/mach-es7000/mach_mpparse.h>
-#include <asm/mach-es7000/mach_wakecpu.h>
static __init int probe_es7000(void)
{
return 0;
}
-struct genapic apic_es7000 = APIC_INIT("es7000", probe_es7000);
+struct genapic apic_es7000 = {
+ APIC_INIT("es7000", probe_es7000),
+ .send_ipi_mask = send_IPI_mask_sequence
+};
}
return 0;
}
-
-int hard_smp_processor_id(void)
-{
- return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
-}
/*
* APIC driver for the IBM "Summit" chipset.
*/
-#define APIC_DEFINITION 1
#include <xen/config.h>
#include <xen/cpumask.h>
#include <asm/current.h>
#include <xen/string.h>
#include <xen/smp.h>
#include <xen/init.h>
+#include <asm/mach_ipi.h>
#include <asm/mach-summit/mach_apic.h>
-#include <asm/mach-summit/mach_apicdef.h>
-#include <asm/mach-summit/mach_ipi.h>
#include <asm/mach-summit/mach_mpparse.h>
static __init int probe_summit(void)
return 0;
}
-struct genapic apic_summit = APIC_INIT("summit", probe_summit);
+struct genapic apic_summit = {
+ APIC_INIT("summit", probe_summit),
+ .send_ipi_mask = send_IPI_mask_sequence
+};
#include <asm/flushtlb.h>
#include <asm/smpboot.h>
#include <asm/hardirq.h>
+#include <asm/mach_ipi.h>
#include <mach_apic.h>
-#include <mach_ipi.h>
/*
* Some notes on x86 processor bugs affecting SMP operation:
local_irq_restore(flags);
}
-inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
+void send_IPI_mask_sequence(cpumask_t mask, int vector)
{
unsigned long cfg, flags;
unsigned int query_cpu;
#define APIC_DEFAULT_PHYS_BASE 0xfee00000
#define APIC_ID 0x20
+#define APIC_ID_MASK (0xFFu<<24)
+#define GET_APIC_ID(x) (((x)>>24)&0xFFu)
+#define SET_APIC_ID(x) (((x)<<24))
#define APIC_LVR 0x30
#define APIC_LVR_MASK 0xFF00FF
#define GET_APIC_VERSION(x) ((x)&0xFF)
char *productid);
int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
- unsigned (*get_apic_id)(unsigned long x);
unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
/* ipi */
- void (*send_IPI_mask)(cpumask_t mask, int vector);
+ void (*send_ipi_mask)(cpumask_t mask, int vector);
};
#define APICFUNC(x) .x = x
-#define APIC_INIT(aname, aprobe) { \
+#define APIC_INIT(aname, aprobe) \
.name = aname, \
.probe = aprobe, \
.int_delivery_mode = INT_DELIVERY_MODE, \
APICFUNC(apicid_to_cpu_present), \
APICFUNC(check_phys_apicid_present), \
APICFUNC(mps_oem_check), \
- APICFUNC(get_apic_id), \
APICFUNC(cpu_mask_to_apicid), \
APICFUNC(acpi_madt_oem_check), \
- APICFUNC(send_IPI_mask), \
APICFUNC(enable_apic_mode), \
- APICFUNC(phys_pkg_id), \
- }
+ APICFUNC(phys_pkg_id)
extern struct genapic *genapic;
+++ /dev/null
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x)
-{
- return (((x)>>24)&0xFF);
-}
-
-#define GET_APIC_ID(x) get_apic_id(x)
-
-#endif
+++ /dev/null
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
- send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
#ifndef __ASM_MACH_APIC_H
#define __ASM_MACH_APIC_H
-#include <mach_apicdef.h>
#include <asm/smp.h>
#define APIC_DFR_VALUE (APIC_DFR_FLAT)
+++ /dev/null
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x)
-{
- return (((x)>>24)&0xF);
-}
-
-#define GET_APIC_ID(x) get_apic_id(x)
-
-#endif
+++ /dev/null
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_bitmask(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
- send_IPI_mask_bitmask(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
--- /dev/null
+#ifndef __ASM_MACH_MPSPEC_H
+#define __ASM_MACH_MPSPEC_H
+
+#define MAX_IRQ_SOURCES 256
+
+/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
+/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
+#define MAX_MP_BUSSES 260
+
+#endif /* __ASM_MACH_MPSPEC_H */
+++ /dev/null
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x)
-{
- return (((x)>>24)&0xFF);
-}
-
-#define GET_APIC_ID(x) get_apic_id(x)
-
-#endif
+++ /dev/null
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
- send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
+++ /dev/null
-#ifndef __ASM_MACH_WAKECPU_H
-#define __ASM_MACH_WAKECPU_H
-
-/*
- * This file copes with machines that wakeup secondary CPUs by the
- * INIT, INIT, STARTUP sequence.
- */
-
-#ifdef CONFIG_ES7000_CLUSTERED_APIC
-#define WAKE_SECONDARY_VIA_MIP
-#else
-#define WAKE_SECONDARY_VIA_INIT
-#endif
-
-#ifdef WAKE_SECONDARY_VIA_MIP
-extern int es7000_start_cpu(int cpu, unsigned long eip);
-static inline int
-wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
-{
- int boot_error = 0;
- boot_error = es7000_start_cpu(phys_apicid, start_eip);
- return boot_error;
-}
-#endif
-
-#define TRAMPOLINE_LOW maddr_to_virt(0x467)
-#define TRAMPOLINE_HIGH maddr_to_virt(0x469)
-
-#define boot_cpu_apicid boot_cpu_physical_apicid
-
-static inline void wait_for_init_deassert(atomic_t *deassert)
-{
-#ifdef WAKE_SECONDARY_VIA_INIT
- while (!atomic_read(deassert));
-#endif
- return;
-}
-
-/* Nothing to do for most platforms, since cleared by the INIT cycle */
-static inline void smp_callin_clear_local_apic(void)
-{
-}
-
-static inline void store_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
-{
-}
-
-#if APIC_DEBUG
- #define inquire_remote_apic(apicid) __inquire_remote_apic(apicid)
-#else
- #define inquire_remote_apic(apicid) {}
-#endif
-
-#endif /* __ASM_MACH_WAKECPU_H */
+++ /dev/null
-#ifndef _GENAPIC_MACH_APICDEF_H
-#define _GENAPIC_MACH_APICDEF_H 1
-
-#ifndef APIC_DEFINITION
-#include <asm/genapic.h>
-
-#define GET_APIC_ID (genapic->get_apic_id)
-#endif
-
-#endif
+++ /dev/null
-#ifndef _MACH_IPI_H
-#define _MACH_IPI_H 1
-
-#include <asm/genapic.h>
-
-#define send_IPI_mask (genapic->send_IPI_mask)
-
-#endif
+++ /dev/null
-#ifndef __ASM_MACH_MPSPEC_H
-#define __ASM_MACH_MPSPEC_H
-
-#define MAX_IRQ_SOURCES 256
-
-/* Summit or generic (i.e. installer) kernels need lots of bus entries. */
-/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
-#define MAX_MP_BUSSES 260
-
-#endif /* __ASM_MACH_MPSPEC_H */
+++ /dev/null
-#ifndef __ASM_MACH_APICDEF_H
-#define __ASM_MACH_APICDEF_H
-
-static inline unsigned get_apic_id(unsigned long x)
-{
- return (((x)>>24)&0xFF);
-}
-
-#define GET_APIC_ID(x) get_apic_id(x)
-
-#endif
+++ /dev/null
-#ifndef __ASM_MACH_IPI_H
-#define __ASM_MACH_IPI_H
-
-void send_IPI_mask_sequence(cpumask_t mask, int vector);
-
-static inline void send_IPI_mask(cpumask_t mask, int vector)
-{
- send_IPI_mask_sequence(mask, vector);
-}
-
-#endif /* __ASM_MACH_IPI_H */
--- /dev/null
+#ifndef __ASM_MACH_IPI_H
+#define __ASM_MACH_IPI_H
+
+#include <asm/genapic.h>
+
+void send_IPI_mask_bitmask(cpumask_t mask, int vector);
+void send_IPI_mask_sequence(cpumask_t mask, int vector);
+
+#define send_IPI_mask (genapic->send_ipi_mask)
+
+#endif /* __ASM_MACH_IPI_H */
#ifdef CONFIG_X86_LOCAL_APIC
-#ifdef APIC_DEFINITION
-extern int hard_smp_processor_id(void);
-#else
-#include <mach_apicdef.h>
static inline int hard_smp_processor_id(void)
{
/* we don't want to mark this access volatile - bad code generation */
return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
}
-#endif
static __inline int logical_smp_processor_id(void)
{